#pragma once
class CBoard
{
    uint board[128];
    uint mailbox[128];
    uint mailbox64[64];

    BITBOARD white_pieces;
    BITBOARD black_pieces;

    BITBOARD pieces;

    uint flags;
    uint enpassant;
    uint wking;
    uint bking;

    CUtil util;
    CStack history;
    CHash hash[1];

    uint color;


public:
	CBoard();
	~CBoard();

    // reset board
    uint Rst();
    uint Add( uint sq, uint piece );
    uint Remove( uint sq );
    uint Select( uint color );
    uint Next( );
    uint Get( uint sq ) const { return board[sq]; };
    uint Print();
    uint SetFlags( uint f )         
        { flags = f; return 0; };
    uint GetFlags(  )const          
        { return flags; };
    uint SetEnpassant( uint ep )    
        { enpassant = ep; return 0; };
    uint GetEnpassant(  )const      { return enpassant; };
    uint GetKingSquare( uint color ) { return ((IS_WHITE(color)) ? wking : bking ); };
    uint SetColor( uint c )         
        { color = c; return 0; };
    uint GetColor(  )const          { return color; };
    uint UnderAtack( uint sq, uint color );
    uint UnderCheck( uint c );
    uint PushInfo();
    uint PopInfo();
    uint PrintChecks(uint color);
    uint64 GetHash();
    uint64 IsDraw( );

private:

};

